<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
    <%@ taglib uri="/struts-tags" prefix="s"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>添加用户</title>
<link href="../css/table.css" rel="stylesheet" type="text/css">
</head>
<script src="../js/jquery-1.8.3.min.js"></script>
<script>
var index = 0;
var diao = [{'type':'服务类型','id':'cstype'},{'type':'服务方式','id':'csstyle'},{'type':'服务效果','id':'cseffect'}];
	$(document).ready(function(){
		dy();
		
	});
	
	function dy(){
		if(index<diao.length){
			getDDL(diao[index].type,diao[index].id);
			setTimeout('dy()',100);
			index++;
		}
	}
	function getDDL(type,id){
		var date = new Date();
		$.getJSON("byTypeDDL.action",{"ddl.typeType":type,"date":date.getTime()},function(data){
			var o = "#"+id;
			var obj=$(o);
   		 for ( var i = 0; i < data.length; i++) {
   			 $(obj).append('<option value="'+data[i].id+'">'+data[i].value+'</option>');
			 }
		});
	}
	
	
</script>
<body>
		<s:if test="#request.customers==null">
			<jsp:forward page="addCS_blank.jsp" />
		</s:if>
		
<form action="saveCustService.action" method="post">
		<table width="600">
			
	    	<tr>
				<td class="table_rightf">操作员：</td>
				<td class="tableleftf"><s:property value="#session.USER.usEmpname"/>
				</td>
			</tr>
            
            <tr>
				<td class="table_rightf">客户：</td>
				<td class="tableleftf">
					<select id="cscust" name="cscustmoter">
						<s:iterator value="#request.customers">
							<option value="<s:property value="custCid"/>"><s:property value="custName"/></option>
						</s:iterator>
					</select>
				</td>
			</tr>
            
			<tr>
				<td class="table_rightf">服务类型：</td>
				<td class="tableleftf">
					<select id="cstype" name="cstype">
						
					</select>
				</td>
			</tr>
			<tr>
				<td class="table_rightf">服务方式：</td>
				<td class="tableleftf">
					<select id="csstyle" name="csstyle">
						
					</select>
				</td>
			</tr>
			<tr>
				<td class="table_rightf">服务效果：</td>
				<td class="tableleftf">
					<select id="cseffect" name="cseffect">
						
					</select>
				</td>
			</tr>
			
			<tr>
				<td class="table_rightf">内容：</td>
				<td class="tableleftf"><textarea name="other" cols="50" rows="6"></textarea></td>
			</tr>
			
			<tr>
				<td>&nbsp;</td>
				<td><input type="submit" value ="  保存  "/>		&nbsp;&nbsp;	  <input type="button" value ="  返回  " onclick="goLogin();"/></td>
			</tr>
			
  </table>	
	</form>
</body>
</html>